<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .loginbox{
            float: right;
        }
    </style>
</head>
<body>
   <a href="/addnote">添加笔记</a>
   <p class="loginbox">
        <% if(username){%>
            尊贵的：<%=username%> 您好。
            <a href="/center">个人中心</a>
            <a href="/logout">退出登录</a>
        <% }else{ %>
            <a  href="/login">登录</a>
            <a href="/register">注册</a>
        <%}%>
   </p>
   <ul>
       <% data.forEach(item=>{%>
        <li>
            <a href="/detail/<%=item.id%>"><%=item.title%></a>
            <!-- <span>time</span> -->
            <a href="/update?id=<%=item._id%>">编辑</a>
            <a href="/delnote/<%=item._id%>">删除</a>
        </li>
       <%})%>
   </ul>
</body>
</html>